
package NewGW;

import gnu.io.SerialPortEvent;
import gnu.io.SerialPortEventListener;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Pattern;

import utils.variable;

/**
 *
 */
public class waitingConnection extends Thread
	{
	/**
	 * Variables
	 */
	private boolean done;
	String mode;
	
	/**
	 * Constructeur
	 */
	public waitingConnection(String mode)
		{
		done = true;
		this.mode = mode;
		start();
		}
	
	
	public void run()
		{
		try
			{
			while(done)
				{
				variable.getaWindow().addInfoDesc("## "+mode+" connection in progress #### Waiting answer #### Be sure that gateway is available ##",true);
				this.sleep(2000);
				}
			}
		catch(Exception exc)
			{
			exc.printStackTrace();
			System.out.println(exc.getMessage());
			}
		}
	
	public void setDone(boolean done)
		{
		System.out.println("Fermeture du Thread d'attente de connexion "+mode);
		this.done = done;
		}
	
	/*2012*//*RATEL Alexandre 8)*/
	}
